package com.young.springdemo.service.adapter;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class TestCar {

//    @PostConstruct
    public void test() throws Exception {
        //需要配置适配器类
        Class<?> aClass = Class.forName("com.young.springdemo.service.adapter.EmerCarControllerAdapter");
        PoliceCarController policeCarController = (PoliceCarController) aClass.newInstance();
        policeCarController.alarm();
        policeCarController.light();
        policeCarController.move();
    }
}
